/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Presentation;

import javax.swing.JComponent;
import javax.swing.JTextField;

/**
 *
 * @author Domenico
 */
class InputVerifierNumber extends InputVerifierNotEmpty {
   

    public InputVerifierNumber(String nomeCampo) {
        super(nomeCampo);
    }

    @Override
    public boolean verify(JComponent input) {
        boolean check = super.verify(input);
        if (!check) {
            JTextField tf = (JTextField) input;
            Integer integer = Integer.getInteger(tf.getText());
            check = integer != null;
            if (!check) {
                notificaErrore("Inserire un valore numerico nel campo: ", "Valore numerico", input);
            }
        }
        return check;
    }
    
    
    
}
